=begin

This file is part of the RSIF project, http://rsif.googlecode.com

Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com>

rsif is free software: you can redistribute it and/or modify
it under the terms of the gnu general public license as published by
the free software foundation, either version 3 of the license, or
(at your option) any later version.

rsif is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.  see the
gnu general public license for more details.

you should have received a copy of the gnu general public license
along with rsif.  if not, see <http://www.gnu.org/licenses/>.
=end

require "classes/roleclass"
require "classes/probefactory"
require "classes/abstract"
require "modules/module"

class X < Rsif::Core::Modules::Module
  include Rsif::Core::Classes::ProbeFactory

  instance_provide :x_instance
end

class A < X
  # este include hace que la clase sea abstracta, es decir
  # que no se pueda instanciar
  include Rsif::Core::Classes::Abstract
end

class B < A
	def self.can_instantiate
		1
	end
	def good
		1
	end
end

class A < X
end

class C < X
end

class Y < Rsif::Core::Modules::Module
    # indice que instanciar esto provee ese simbolo
   instance_provide :y_instance
#    depends_on :x_instance

end

class Z < Rsif::Core::Modules::Module
    depends_on :y_instance

    def cop
	logger.info ":y_instance: #{symbol(:y_instance) }"
    end
end

Rsif::Core::Context.instance.logger.info "X.create: #{X.create if X.can_instantiate}\n"

include Rsif::Core::Logging

logger.info "Y.create: #{Y.create if Y.can_instantiate}\n"
logger.info "Z.create: #{Z.create if Z.can_instantiate}\n"

logger.info {"yielded message"}
logger.log(1) {"another yielded message"}

z = Z.create

z.cop

